/// FileName: icon_menu_item
/// Author: admin
/// Date: 2021-06-10 16:57
/// Description: 图标菜单项

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:high_help_apps/common/values/define.dart';

class IconMenuItem extends StatelessWidget {
  IconMenuItem({required this.iconLink, required this.title, required this.onPressed, this.decoration});

  final String iconLink;
  final String title;
  final vfunc onPressed;
  final BoxDecoration? decoration;

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.symmetric(horizontal: 5.0.r),
      child: Material(
        color: Colors.transparent,
        child: Ink(
          child: InkWell(
            onTap: onPressed,
            child: Container(
              width: 60.w,
              height: 80.h,
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Container(
                    height: 25.r,
                    width: 25.r,
                    margin: EdgeInsets.symmetric(vertical: 10.0.r),
                    decoration: decoration,
                    child: ClipOval(
                      child: Image.asset(this.iconLink),
                    ),
                  ),
                  Text(
                    this.title,
                    style: TextStyle(
                        fontSize: 12.5.sp,),
                         overflow: TextOverflow.ellipsis
                  )
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}
